package homework6;

public class TestMySql {
    public static void main(String[] args) {
        //第一套数据库创建匿名内部类
        DatabaseQuery mySqlQuery1 = new DatabaseQuery(){
            @Override
            public void executeQuery(String query) {
                System.out.println("第一种查询方法......");
            }
        };
        mySqlQuery1.executeQuery("select * from database");
        //第一套数据库创建匿名内部类
        DatabaseQuery mySqlQuery2 = new DatabaseQuery(){
            @Override
            public void executeQuery(String query) {
                System.out.println("第二种查询方法......");
            }
        };
        mySqlQuery2.executeQuery("select * from database where nane = zhangsan");
    }
}
